<template>
	<div class="box">
		<div class="header">
			<div class="left">
				<!--箭头--><!--$router.back(-1)-->
				<em class="ems1" v-if="showheader.left[0]" @click="go()"></em>
				<!--信封-->
				<em class="ems2" v-if="showheader.left[1]"></em>
				<!--文本-->
				<i>{{showheader.leftword}}</i>
			</div>
			<div class="right">
				<!--公告-->
				<em class="ems1" v-if="showheader.right[0]" @click="$router.push({path:'/Information'})"></em>
				<!--设置-->
				<em class="ems2" v-if="showheader.right[1]" @click="$router.push({path:'/Shezhi'})"></em>
				<!--购物车-->
				<em class="ems3" v-if="showheader.right[2]" @click="$router.push({path:'/ShoppingCart'})"></em>
				<!--分享-->
				<em class="ems4" v-if="showheader.right[3]"></em>
				<!--首页-->
				<em class="ems5" v-if="showheader.right[4]"></em>
				<!--文本-->
				<i>{{showheader.rightword1}}</i>
				<i class="i2">{{showheader.rightword2}}</i>
				<!--更多-->
				<em class="ems6" v-if="showheader.right[5]" @click="more">
					<ul>
						<li><a href="">消息</a></li>
						<li><a @click="$router.push({path:'/HomePage'})">首页</a></li>
						<li><a href="">分享</a></li>
						<li><a href="#/PersonalCenter/0">个人中心</a></li>
						<li></li>
					</ul>
				</em>
			</div>
			<span>{{showheader.word}}</span>
	  </div>
	</div>
	
</template>

<script>
	export default{
		name :"Gheader",
		props:["showheader"],
		data(){
				return{
					bol:false,
					jiantou:this.showheader.jiantouurl
				}
		},
		methods:{
			go:function(){
				if(this.jiantou==""||this.jiantou==undefined){
					this.$router.back(-1);
				}else{
					this.$router.push({path:this.jiantou})
				}
				
			},
			more:function  () {
				if(this.bol){
					$(".ems6 ul").css("display","block");
					this.bol=!this.bol;
					var timer=setTimeout(function  () {
						$(".ems6 ul").css("display","none");
						this.bol=!this.bol;
						clearTimeout(timer);
					},2000);
				}else{
					$(".ems6 ul").css("display","none");
					this.bol=!this.bol;
				}
				
			}
		}
	}
</script>

<style scoped>
i{
	font-style:normal;
	color: white;
	font-size: 1.3rem;
	position: relative;
	top: -0.2rem;
	font-weight: 100;
}
.i2{
	display:inline-block;
	border-left: 1px solid white;
	padding-left:0.4rem ;
	line-height: 1.3rem;
	
}
.box{
		width: 100%;
		height: 10vh;
}
.left{
	float: left;
	z-index: 5;
}
.right{
	float: right;
	z-index: 5;
}

.header{
	    width: 94.4%;
		height: 5vh;
		padding:5vh 2.8% 0;
		background: #e53e42;
		position: fixed;
		left: 0;
	    top: 0;
	    z-index: 10;
}
em{
	display: inline-block;
	width:1.69rem ;
	height: 1.69rem;
	background: red;
	
}
.left>.ems1{
	background: url(../../../assets/commonImg/导航箭头.png) no-repeat;
	background-size: 50% 90%;
	background-position-y: center;
}
.left>.ems2{
	background: url(../../../assets/commonImg/信封.png) no-repeat;
	background-size: 100% 100%;
}
.left>.ems3{
	background: url(../../../assets/commonImg/导航箭头.png) no-repeat;
	background-size: 100% 100%;
}
.right>.ems1{
	background: url(../../../assets/commonImg/公告.png) no-repeat;
	background-size: 100% 100%;
}
.right>.ems2{
	background: url(../../../assets/commonImg/设置.png) no-repeat;
	background-size: 100% 100%;
}
.right>.ems3{
	background: url(../../../assets/commonImg/购物车前.png) no-repeat;
	background-size: 100% 100%;
	
}
.right>.ems4{
	background: url(../../../assets/commonImg/分享.png) no-repeat;
	background-size:100% 100%;
	
}
.right>.ems5{
	background: url(../../../assets/commonImg/首页前.png) no-repeat;
	background-size: 100% 100%;
}

.right>.ems6{
	background: url(../../../assets/commonImg/更多.png) no-repeat;
	background-size: 100% 30%;
	background-position-y: 50%;
}

.left>em{
	margin-right:0.7rem;
}
.right>em{
	margin-left:0.7rem;
}
span{
	font-size: 1.5rem;
	color: white;
	display:block;
	width: 44%;
	margin-top:-0.2rem ;
	position: absolute;
	text-align: center;
	left:28%;
	font-weight: 200;
	z-index: -1;
}
.ems6 ul{
	display: none;
	background: white;
	border: 1px solid #CCCCCC;
	width: 7.667rem;
	padding:1rem 0 ;
	border-radius:8px ;
	position: fixed;
	right: 2.8vw;
	top: 9vh;
}
.ems6 ul>li {
	height: 2.875rem;
}
.ems6 ul>li a{
	display: block;
	line-height: 2.875rem;
	font-style: normal;
	font-size: 1.3rem;
	color: #000000;
	padding-left: 2rem;
}
.ems6 ul>li:nth-child(1) a{
	background: url(../../../assets/commonImg/消息.png) no-repeat;
}
.ems6 ul>li:nth-child(2) a{
	background: url(../../../assets/commonImg/首页黑.png) no-repeat;
}
.ems6 ul>li:nth-child(3) a{
	background: url(../../../assets/commonImg/分享黑.png) no-repeat;
}
.ems6 ul>li:nth-child(4) a{
	background: url(../../../assets/commonImg/个人黑.png) no-repeat;
}
.ems6 ul>li:nth-child(n) a{
	background-position:10% 50% ;
	background-size: 1.2rem;
}
.ems6 ul>li:nth-child(5){
	display: inline-block;
	width: 1.0rem;
	height: 1.0rem;
	background: white;
	position: absolute;
	transform: rotate(-45deg);
	top: -0.5rem;
	right: 11px;
}
</style>